//
// File:	GuiElements.hpp
// Author:	Thomas TISSOT-DUPONT
// Login:	<thomas.tissotdupont@free.fr>
//
// Create:	28/01/2010 at 23:12:27
// Purpose:	
//
#ifndef GUIELEMENTS_HPP
#define GUIELEMENTS_HPP

#include <QtGui/QLabel>
#include <QtGui/QComboBox>
#include <QtGui/QGroupBox>
#include <QtGui/QListWidget>
#include <QtGui/QPushButton>
#include <QtGui/QLineEdit>
#include <QtGui/QTableWidget>
#include <QtGui/QCheckBox>
#include <QtGui/QPicture>
#include <QtGui/QPixmap>
#include <QtGui/QImage>
#include "IGuiElement.hpp"

namespace GuiElementUtils
{
	void		UpdateWidgetFont(QWidget &widget, float flRatioWidth, float flRatioHeight);
	void		UpdateWidgetSize(QWidget &widget, float flRatioWidth, float flRatioHeight);
	void		UpdateWidgetPosition(QWidget &widget, float flRatioWidth, float flRatioHeight);
}

class GuiLabel : public QLabel, public IGuiElement
{
	Q_OBJECT

public:
				GuiLabel(QWidget *pParent = NULL);
	void		repositionOnScreen(float flRatioWidth, float flRatioHeight);
};

class GuiImage : public QLabel, public IGuiElement
{
	Q_OBJECT

public:
				GuiImage(QWidget *pParent = NULL);
	void		repositionOnScreen(float flRatioWidth, float flRatioHeight);
};

class GuiGroupBox : public QGroupBox, public IGuiElement
{
	Q_OBJECT

public:
				GuiGroupBox(QWidget *pParent = NULL);
	void		repositionOnScreen(float flRatioWidth, float flRatioHeight);
};

class GuiPushButton : public QPushButton, public IGuiElement
{
	Q_OBJECT

public:
				GuiPushButton(QWidget *pParent = NULL);
	void		repositionOnScreen(float flRatioWidth, float flRatioHeight);

protected:
	void		enterEvent(QEvent *e);

private slots:
	void		onPressed();
};

class GuiComboBox : public QComboBox, public IGuiElement
{
	Q_OBJECT

public:
				GuiComboBox(QWidget *pParent = NULL);
	void		repositionOnScreen(float flRatioWidth, float flRatioHeight);

protected:
	void		enterEvent(QEvent *e);
};

class GuiListWidget : public QListWidget, public IGuiElement
{
	Q_OBJECT

public:
				GuiListWidget(QWidget *pParent = NULL);
	void		repositionOnScreen(float flRatioWidth, float flRatioHeight);
};

class GuiLineEdit : public QLineEdit, public IGuiElement
{
	Q_OBJECT

public:
				GuiLineEdit(QWidget *pParent = NULL);
	void		repositionOnScreen(float flRatioWidth, float flRatioHeight);

protected:
	void		enterEvent(QEvent *e);
};

class GuiTableWidget : public QTableWidget, public IGuiElement
{
	Q_OBJECT

public:
				GuiTableWidget(QWidget *pParent = NULL);
	void		repositionOnScreen(float flRatioWidth, float flRatioHeight);
};

class GuiCheckBox : public QCheckBox, public IGuiElement
{
	Q_OBJECT

public:
				GuiCheckBox(QWidget *pParent = NULL);
	void		repositionOnScreen(float flRatioWidth, float flRatioHeight);

protected:
	void		enterEvent(QEvent *e);
};

#endif //!GUIELEMENTS_HPP
